package com.codi.api.xxljob;

import com.codi.bus.core.service.UserService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import com.xxl.job.core.log.XxlJobLogger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author lvgo
 * @version 1.0
 * @Description: 检查机构用户状态，发送短信
 * 0 0 18,19 * * ?
 * @date 18-6-29 下午5:39
 */
@Slf4j
@Component
@JobHandler("queryOrgStateHandler")
public class QueryOrgStateHandler extends IJobHandler {
    @Resource
    private UserService userService;

    @Override
    public ReturnT<String> execute(String param) throws Exception {
        userService.checkOrgAcctStateAndSMS();
        XxlJobLogger.log("QueryOrgStateHandler, success");
        return SUCCESS;
    }
}
